package com.ynny.example08.Map;

import java.util.*;

public class bbb {
    public static void main(String[] args) {
        Map<String, List<String>> mm = new HashMap<>();
        List<String> list = new ArrayList<>();
        list.add("昆明");
        list.add("玉溪");
        list.add("曲靖");
        mm.put("云南", list);
        list = new ArrayList<>();
        list.add("成都");
        list.add("自贡");
        list.add("攀枝花");
        mm.put("四川", list);
        Scanner sc = new Scanner(System.in);
        while (true){
            System.out.println("欢迎使用城市查询系统");
            Set shengFei = mm.keySet();
            for(Object o:shengFei){
                System.out.print(o+"  ");
            }
            System.out.println();
            System.out.print("请输入省份:");
            String sf = sc.next();
            if(mm.containsKey(sf)){
                List<String> l = mm.get(sf);
                for(String s:l){
                    System.out.println(s);
                }
            }else{
                System.out.println("没有这个省份");
            }
        }

    }
}
